//
//  HomePageControl.m
//  HengYouCai
//
//  Created by apple on 2018/5/16.
//  Copyright © 2018年 lwj. All rights reserved.
//

#import "HomePageControl.h"

@implementation HomePageControl

- (instancetype)init
{
    if (self = [super init]) {
        //
        self.userInteractionEnabled = NO;
    }
    return self;
}
- (void)setCurrentPage:(NSInteger)currentPage
{

    [super setCurrentPage:currentPage];
    for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++) {
        
        if (subviewIndex == currentPage) {
            UIView* subview = [self.subviews objectAtIndex:subviewIndex];
            [subview setFrame:CGRectMake((subview.frame.origin.x-0.6), subview.frame.origin.y,18,7)];
            subview.backgroundColor = Normal_RedColor;
        }else{
            UIView* subview = [self.subviews objectAtIndex:subviewIndex];
            subview.backgroundColor = UIColor.whiteColor;
//            [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y,7,7)];
        }
        

        
    }
}
@end
